#include <iostream>
using namespace std;

struct Node{
	int num;
	Node * next;
};

void insert(Node *Head,Node * node){
	while(Head->next != NULL){
		if(node->num < Head->next->num){
			Node *temp = Head->next;
			Head->next = node;
			node->next = temp;
			return;
		}
		Head = Head->next;
	}
	Head->next = node;
}

void del(Node *Head,int num){
	while(Head->next != NULL){
		if(Head->next->num == num){
			Head->next = Head->next->next;
		}
		Head = Head->next;
	}
}

void main(){
	int num;
	Node *Head;
	Head->next = NULL;
	cout << "Input the num of No:" << endl;
	cin >> num;
	for(int i = 0;i < num;i++){
		Node *n = new Node;
		n->next = NULL;
		cin >> n->num;
		insert(Head,n);
	}
	while(Head->next != NULL){
		cout <<  Head->next->num << "  ";
		Head = Head->next;
	}
	cout << endl;
	system("pause");
}